package com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest

import com.lancoo.cpbase.authentication.base.CurrentUser
import com.lancoo.cpbase.authentication.base.FileManager
import com.lancoo.znbkxx.teacher.Ext
import org.json.JSONObject
import java.util.*

/**
 * 页面描述：Constants
 *
 * Created by ditclear on 2017/11/19.
 */
object Constants {
    /*
   * 自定义Post公共传参
   * */
    fun createJSONObject(): JSONObject {

        if(Ext.GLOBAL_GRADE_STU == "K6" ||Ext.GLOBAL_GRADE == "K7"||Ext.GLOBAL_GRADE == "K8"||Ext.GLOBAL_GRADE == "K9"){
            Ext.STAGE_NO = "B"
        }else if(Ext.GLOBAL_GRADE == "K10"||Ext.GLOBAL_GRADE == "K11"||Ext.GLOBAL_GRADE == "K12"){
            Ext.STAGE_NO = "C"
        }

        val Map = JSONObject()
        Map.put("Token", CurrentUser.getToken())
        Map.put("UserID", CurrentUser.UserID)
        Map.put("SchoolID", CurrentUser.SchoolID)
        Map.put("GlobalGrade", Ext.GLOBAL_GRADE)
        Map.put("CourseClassID", Ext.COURSE_CLASSID)
        Map.put("StageNo", Ext.STAGE_NO )
        Map.put("SubjectID", "C")
        Map.put("ReplaceBlank", true)
        Map.put("ReplaceUrl", true)
        Map.put("IsSerial",true)
        Map.put("IsReplace",true)
        return Map
    }

    /*
    * 自定义Get公共传参
    * */
    fun createParamas(): MutableMap<String, Any> {

        if(Ext.GLOBAL_GRADE_STU == "K6" ||Ext.GLOBAL_GRADE == "K7"||Ext.GLOBAL_GRADE == "K8"||Ext.GLOBAL_GRADE == "K9"){
            Ext.STAGE_NO = "B"
        }else if(Ext.GLOBAL_GRADE == "K10"||Ext.GLOBAL_GRADE == "K11"||Ext.GLOBAL_GRADE == "K12"){
            Ext.STAGE_NO = "C"
        }

        val paramas: MutableMap<String, Any> = HashMap<String, Any>()
        paramas["Token"] = CurrentUser.getToken()
        paramas["ProvinceID"] = Ext.PROVINCE_ID
        paramas["CityID"] =Ext.CITY_ID
        paramas["SchoolID"] = CurrentUser.SchoolID
        paramas["CourseClassID"] = Ext.COURSE_CLASSID
        paramas["GlobalGrade"] = Ext.GLOBAL_GRADE
        paramas["SubjectID"] = "C"
        paramas["StageNo"] = Ext.STAGE_NO
        paramas["UserID"] = CurrentUser.UserID
        paramas["TID"] = CurrentUser.UserID
        paramas["IsSerial"] = true
        paramas["IsReplace"] = true
        paramas["PlatForm"] = 1
        return paramas
    }

    /****************************************************************************************************/
    /*
    * 自定义Post公共传参
    * */
    fun createJSONObjectOne(): JSONObject {

        if(Ext.GLOBAL_GRADE_STU == "K6" ||Ext.GLOBAL_GRADE_STU == "K7"||Ext.GLOBAL_GRADE_STU == "K8"||Ext.GLOBAL_GRADE_STU == "K9"){
            Ext.STAGE_NO = "B"
        }else if(Ext.GLOBAL_GRADE_STU == "K10"||Ext.GLOBAL_GRADE_STU == "K11"||Ext.GLOBAL_GRADE_STU == "K12"){
            Ext.STAGE_NO = "C"
        }

        val Map = JSONObject()
        Map.put("Token", CurrentUser.getToken())
        Map.put("UserID", CurrentUser.UserID)
        Map.put("GlobalGrade", Ext.GLOBAL_GRADE_STU)
        Map.put("CourseClassID", Ext.COURSE_CLASSID)
        Map.put("StageNo", Ext.STAGE_NO )
        Map.put("SubjectID", "C")
        Map.put("ReplaceBlank", true)
        Map.put("ReplaceUrl", true)
        Map.put("IsSerial",true)
        Map.put("IsReplace",true)
        return Map
    }

    /*
    * 自定义Get公共传参
    * */
    fun ParamasOne(): MutableMap<String, Any> {

        if(Ext.GLOBAL_GRADE_STU == "K6" ||Ext.GLOBAL_GRADE_STU == "K7"||Ext.GLOBAL_GRADE_STU == "K8"||Ext.GLOBAL_GRADE_STU == "K9"){
            Ext.STAGE_NO = "B"
        }else if(Ext.GLOBAL_GRADE_STU == "K10"||Ext.GLOBAL_GRADE_STU == "K11"||Ext.GLOBAL_GRADE_STU == "K12"){
            Ext.STAGE_NO = "C"
        }

        val paramas: MutableMap<String, Any> = HashMap<String, Any>()
        paramas["Token"] = CurrentUser.Token
        paramas["CourseClassID"] = Ext.COURSE_CLASSID
        paramas["GlobalGrade"] = Ext.GLOBAL_GRADE_STU
        paramas["SubjectID"] = "C"
        paramas["StageNo"] = Ext.STAGE_NO
        paramas["UserID"] = CurrentUser.UserID
        paramas["TID"] = CurrentUser.UserID
        paramas["IsSerial"] = true
        paramas["IsReplace"] = true
        paramas["PlatForm"] = 1
        return paramas
    }
}